<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ac_types.aspx.cs" Inherits="ac_types" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
            DataKeyNames="ac_type" DataSourceID="SqlDataSource1">
            <Columns>
                <asp:CommandField ShowDeleteButton="True" />
                <asp:BoundField DataField="ac_type" HeaderText="ac_type" ReadOnly="True" 
                    SortExpression="ac_type" />
                <asp:BoundField DataField="tax_type" HeaderText="tax_type" 
                    SortExpression="tax_type" />
            </Columns>
        </asp:GridView>
        <br />
        <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
            DataKeyNames="ac_type" DataSourceID="SqlDataSource1" DefaultMode="Insert" 
            Height="50px" Width="125px">
            <Fields>
                <asp:BoundField DataField="ac_type" HeaderText="ac_type" ReadOnly="True" 
                    SortExpression="ac_type" />
                <asp:BoundField DataField="tax_type" HeaderText="tax_type" 
                    SortExpression="tax_type" />
                <asp:CommandField ShowInsertButton="True" />
            </Fields>
        </asp:DetailsView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:SparrowDB %>"
            DeleteCommand="DELETE FROM [ac_types] WHERE [ac_type] = @ac_type" InsertCommand="INSERT INTO [ac_types] ([ac_type],[tax_type]) VALUES (@ac_type,@tax_type)"
            SelectCommand="SELECT * FROM [ac_types]">
            <DeleteParameters>
                <asp:Parameter Name="ac_type" Type="String" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="ac_type" Type="String" />
                <asp:Parameter Name="tax_type" />
            </InsertParameters>
        </asp:SqlDataSource>
    
    </div>
    </form>
</body>
</html>
